<div class="bjui-pageContent">

    <fieldset style="height: 100%;">
        <legend>预存款变更</legend>
        <form action="{:url()}"
              class="pageForm" data-toggle="validate" data-reload-navtab='true' data-loadingmask="true">
            <div style="margin: 15px auto 0; width: 95%;">
                <div class="pageFormContent" data-layout-h="0">
                    <table class="table table-condensed table-hover table-striped table-bordered" width="100%">
                        <thead>
                        <tr>
                            <th>名称</th>
                            <th>值</th>
                            <th>备注</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr>
                            <td><label style="float: right;">会员ID：</label></td>
                            <td colspan="1"><input type="text" size="30" name="account" id="account" value=""></td>
                            <td><span class="check-tips" id="account_info">（输入会员ID）</span></td>
                            <input type="hidden" value="0" id="user_id" name="user_id"/>
                        </tr>
                        <tr id="show_user" class="hidden">
                            <td><label style="float: right;">查询的会员：</label></td>
                            <td colspan="2" id="show_user_info"></td>
                        </tr>
                        <tr>
                            <td><label style="float: right;">变更的类型：</label></td>
                            <td colspan="2">
                                <input type="radio" name="type" data-toggle="icheck" value="1" checked=""
                                       data-label="增加&nbsp;&nbsp;">
                                <input type="radio" name="type" data-toggle="icheck" value="-1" data-label="减少">
                                <!-- 	<input type="radio" name="type"  data-toggle="icheck" value="2" data-label="冻结">
                                    <input type="radio" name="type"  data-toggle="icheck" value="-2" data-label="解冻"> -->
                            </td>
                        </tr>
                        <tr>
                            <td><label style="float: right;">金额：</label></td>
                            <td colspan="1">
                                <input type="text" size="15" name="amount"
                                       value="0.00"
                                       data-rule="money"
                                       data-rule-money="[/^(?!0+(?:\.0+)?$)(?:[1-9]\d*|0)(?:\.\d{1,2})?$/, '金额必须大于0并且只能精确到分']"
                                       data-tip="请填写金额" value=""></td>
                            <td><span class="check-tips"></span></td>
                        </tr>
                        <tr>
                            <td><label style="float: right;">描述：</label></td>
                            <td colspan="1"><textarea name="message" cols="30" rows="1"
                                                      data-toggle="autoheight"></textarea></td>
                            <td><span class="check-tips">（  描述信息将显示在预存款明细相关页，会员和管理员都可见）</span></td>
                        </tr>
                        <tr>
                            <td><label style="float: right;">备注：</label></td>
                            <td colspan="1"><textarea name="remark" cols="30" rows="1"
                                                      data-toggle="autoheight"></textarea></td>
                            <td><span class="check-tips">（  仅后台可见）</span></td>
                        </tr>
                        </tbody>
                    </table>
                </div>
                <fieldset class="alert alert-info">
                    <ul>
                        <li>此处变更建议少用，或者有控制的使用</li>
                    </ul>
                </fieldset>

            </div>
        </form>
    </fieldset>
</div>
<div class="bjui-pageFooter">
    <ul>
        <li>
            <button class="btn-default" type="submit" data-icon="save">提交</button>
        </li>
    </ul>
</div>
<script type="text/javascript">
    //绑定选择事件
    $("#account").blur(function () {
        $.ajax({
            type: "POST",
            url: "{:url('/ucenter/admin.User/find')}",
            data: {account: $("#account").val()},
            dataType: "json",
            success: function (data) {
                if (0 == data.code) {
                    $("#user_id").val(data.data.id);
                    $('#show_user').removeClass('hidden');
                    $("#show_user_info").html('<span style="color:red">会员账号【' + data.data.account + '】，会员昵称【' + data.data.nickname + '】，账号余额：' + data.data.balance + '，当前冻结余额为' + data.data.freeze_balance + '。</span>');
                } else {
                    $("#account_info").html('<span style="color:red">' + data.message + '</span>');
                    $("#user_id").val(0);
                }
            }
        });
    });
</script>